﻿using System.Text.RegularExpressions;

namespace Art_To_Eagle.Lib.Safebooru
{
    class Post
    {
        public int Id;
        public string[] Tags;
        public string FromPage;
        public string SourceUrl;
        public string PreviewImage;
        public string FileUrl;

        const string PostUrl = "https://safebooru.donmai.us/posts/";
        public static string GetPostTitle(int id)
        {
            var match = Regex.Match(Utils.HttpGet(PostUrl + id), @"<section id=""original-artist-commentary"">[\S\s]+?</section>").Value;
            return Regex.Replace(match, "(\n)|(<.+?>)", "").Trim();
        }
    }
}
